// 走进经开区
import economicZonePhoto from '@/assets/EconomicZone/economicZonePhoto.png';
import lineBg from '@/assets/EconomicZone/linebg.png';
import map from '@/assets/EconomicZone/map.png';
// 首页
import qrCode from '@/assets/homepage/rqCode.png';
import userCenter from '@/assets/homepage/userCenter.svg';
import wuhanLogo from '@/assets/homepage/wuhanLogo.svg';
import national from '@/assets/homepage/national.png';
import dataChart from '@/assets/homepage/dataChart.svg';
import weixin from '@/assets/homepage/weixin.svg';
import toTop from '@/assets/homepage/toTop.svg';
// 底部
import prolicy from '@/assets/FooterImg/policy.svg';
import organization from '@/assets/FooterImg/organization.svg';
import contactwe from '@/assets/FooterImg/contactwe.svg';
import messageBoard from '@/assets/FooterImg/messageBoard.svg';
import Visits from '@/assets/FooterImg/Visits.svg';
import address from '@/assets/FooterImg/address.png';
// 首页
import hotimg from '@/assets/homepage/hotimg.svg';
import helloLogin from '@/assets/homepage/helloLogin.svg';

// 政策公告
import iconListNew from '@/assets/homepage/iconListNew.svg';

// news
import spaceShare from '@/assets/news/spaceShare.svg';
import weiboShare from '@/assets/news/weiboShare.svg';
import weixinShare from '@/assets/news/weixinShare.svg';
import splitLine from '@/assets/news/splitLine.svg';

// 在线申请
import applyStep1 from '@/assets/policyDeclare/apply_step1.svg';
import applyStep2 from '@/assets/policyDeclare/apply_step2.svg';
import applyStep3 from '@/assets/policyDeclare/apply_step3.svg';
import success from '@/assets/policyDeclare/success.svg';
// 政企直通车
import Processed from '@/assets/GovernmentTrain/Processed.svg';
import Satisfaction from '@/assets/GovernmentTrain/Satisfaction.svg';
import Untreated from '@/assets/GovernmentTrain/Untreated.svg';
import volume from '@/assets/GovernmentTrain/volume.svg';
import { getToken } from '@/utils/storage';

function getDayStrByNumber(day) {
  let dayStr;
  switch (day) {
    case 1: {
      dayStr = '一';
      break;
    }
    case 2: {
      dayStr = '二';
      break;
    }
    case 3: {
      dayStr = '三';
      break;
    }
    case 4: {
      dayStr = '四';
      break;
    }
    case 5: {
      dayStr = '五';
      break;
    }
    case 6: {
      dayStr = '六';
      break;
    }
    case 0: {
      dayStr = '日';
      break;
    }
    default:
      break;
  }
  return dayStr;
}

function scrollToTop() {
  window.scroll(0, 0);
}
function highLight(dispatch, key) {
  dispatch({
    type: 'current/fetchIsLogin',
    payload: {
      key,
    },
  });
  localStorage.setItem('key', key);
}

const getIsLogin = () => {
  return getToken() !== null && getToken() !== undefined && getToken() !== '';
};

export {
  economicZonePhoto,
  lineBg,
  map,
  qrCode,
  userCenter,
  wuhanLogo,
  national,
  dataChart,
  weixin,
  toTop,
  prolicy,
  organization,
  contactwe,
  messageBoard,
  Visits,
  address,
  hotimg,
  helloLogin,
  iconListNew,
  spaceShare,
  weiboShare,
  weixinShare,
  splitLine,
  applyStep1,
  applyStep2,
  applyStep3,
  success,
  getDayStrByNumber,
  Processed,
  Satisfaction,
  Untreated,
  volume,
  scrollToTop,
  getIsLogin,
  highLight,
};
